package com.dimples.dd.system.api.user;

import com.dimples.dd.common.constant.DDServerConstant;
import com.dimples.dd.common.model.DDAuthUser;
import com.dimples.dd.system.api.fallback.user.UserFeignFallbackClient;
import com.dimples.dd.web.feign.config.FeignDecoderConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/6/13
 */
@FeignClient(name = DDServerConstant.DD_SERVER_SYSTEM, contextId = "UserFeignClient", fallback = UserFeignFallbackClient.class, configuration = {FeignDecoderConfig.class})
public interface UserFeignClient {

    @GetMapping("/users/{username}/authInfo")
    DDAuthUser getUserAuthUser(@PathVariable("username") String username);

    @PutMapping("/users/login/{userId}")
    void updateUserLogin(@PathVariable("userId") Long userId, @RequestParam("loginIp") String loginIp);
}
